package com.wtc.homework;

/**
 * @author 马可
 * @version 1.0
 * 编程题
 * 2023/5/8
 * IntelliJ IDEA
 */
public class Homework01 {
    public static void main(String[] args) {
        System.out.println(Frock.getNextNum());
        System.out.println(Frock.getNextNum());
        Frock frock = new Frock();
        System.out.println(frock.getSerialNumber());
        Frock frock1 = new Frock();
        System.out.println(frock1.getSerialNumber());
        Frock frock2 = new Frock();
        System.out.println(frock2.getSerialNumber());

    }
}
class Frock {
    private static int currentNum = 100000;
    private int serialNumber;
    public static int getNextNum() {
        return currentNum += 100;
    }

    public Frock() {
        this.serialNumber = getNextNum();
    }

    public Frock(int serialNumber) {
        this.serialNumber = getNextNum();
    }

    public int getSerialNumber() {
        return serialNumber;
    }
}